package com.woniuxy.microaftersaleserver.configure;

import com.woniuxy.microaftersaleserver.utils.StringToDateConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpringMVCConfiguration implements WebMvcConfigurer {
    /**
     配置类型转换器
     * @params:
     * @return
     */
    @Override
    public void addFormatters(FormatterRegistry registry) {
        registry.addConverter(stringToDateConverter());
    }
    @Bean
    public StringToDateConverter stringToDateConverter(){
        return new StringToDateConverter();
    }
}
